﻿#ifndef ZCONTROLGROUPBOX_H
#define ZCONTROLGROUPBOX_H

#include "ZControlWidget.h"
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSlider>
#include <QtWidgets/QLabel>
#include <QList>

class ZControlGroupBox : public QGroupBox
{
    Q_OBJECT
public:
    ZControlGroupBox(QWidget *parent = 0);
    void setupSpeedLevels(QList<double> levels);
    double speed();

public slots:
    void speedUp();
    void speedDown();
    void on_moveUp();
    void on_moveDown();
signals:
    void moveUp(double mmps);
    void moveDown(double mmps);
    void moveUpStop();
    void moveDownStop();
    void stop();
    void changeSpeed(double mmps);

private slots:
    void on_sliderValueChanged(int n);
    void on_button();
private:
    void initSpeedLevels();
    void initContent();
    void initConnection();

private:
    QList<double> m_levels;
    QHBoxLayout *horizontalLayout;
    QVBoxLayout *verticalLayout;
    QSlider *verticalSliderSpeedZ;
    QLabel *labelSpeedZ;
    ZControlWidget *m_zControl;

    QPushButton *pushButtonSpeed1;
    QPushButton *pushButtonSpeed2;
    QPushButton *pushButtonSpeed3;
    QPushButton *pushButtonSpeed4;
    QPushButton *pushButtonSpeed5;
};

#endif // ZCONTROLGROUPBOX_H
